package aer.prueba1;

import java.io.*;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;

public class Lectura {

	public static void main(String[] args) throws Exception {
		StringBuffer sb = new StringBuffer();

		readStream(System.in, sb);
		
		System.out.println("termino");

	}

	private static Charset charset = Charset.forName("UTF-8");
	private static CharsetDecoder decoder = charset.newDecoder();

	public static void readStream(InputStream is, StringBuffer sb) throws IOException{
	     int count = 0;          
	     char[] c = new char[5];
	     InputStreamReader isr = new InputStreamReader( is, charset );          
	     while ((count = isr.read(c)) > 0){
	          sb.append(c, 0, count);
	     }
	}

}
